/*
 * @Author: TalkMan
 * @Date: 2021-06-01 8:51:03
 * @LastEditTime: 2022-03-07 08:33:38
 * @LastEditors: Please set LastEditors
 * @Description: 农资出库接口
 */

import xjaxios from "@/api/axios";

export default {
  /**
   * @description: 获取农资出库信息 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getAgriMateOutOfStockList(params) {
    return xjaxios.post("/material/outQueryPageList", params);
  },
  // 查询所有出库类型
  AgriMateOutQueryType() {
    return xjaxios.get("material/outQueryType");
  },
  // queryMaterialTypeList() {
  //   return xjaxios.get("/material/outQueryType");
  // },
  // 查询出库的农资
  queryByOutList(id) {
    return xjaxios.get(`material/queryByOut/${id}`);
  },
  // 查询出库的农资
  // queryByOutList() {
  //   return xjaxios.get(`material/queryByOut`);
  // },
  /**
   * @description: 新增农资出库信息
   * @param {Object} formData *
   * @return {Object}
   */
  addAgriMateOutOfStock(formData) {
    formData.organizationNo = sessionStorage.organizationNo;
    return xjaxios.post("/material/outWarehousing", formData);
  },

  /**
   * @description: 编辑农资出库信息
   * @param {Object} formData *
   * @return {Object}
   */
  editAgriMateOutOfStock(formData) {
    return xjaxios.post("/material/editOutWarehousing", formData);
  },

  // del: id => xjaxios.get(`/material/delOut${id}`),

  /**
   * @description: 批量删除数据
   * @param {Array} list *
   * @return {Object}
   */
  delAgriMateOutOfStock(list) {
    return xjaxios.post("/material/delOutList", {
      agriculturalMaterialOutOfStockIdList: list
    });
  }
};
